---
sidebar_label: Inherited roles
sidebar_position: 9
description: Manage inherited roles with the Hasura Metadata API
keywords:
  - hasura
  - docs
  - Metadata API
  - API reference
  - inherited roles
  - multiple roles
---

# Metadata API Reference: Inherited Roles

## Introduction

Inherited roles allow you to create a role which inherits permissions
from other existing roles.

:::tip Supported from

The Metadata API is supported for versions `v2.0.0` and above and
replaces the older [schema/Metadata API](/api-reference/schema-metadata-api/index.mdx).

:::

## add_inherited_role {#metadata-add-inherited-role}

`add_inherited_role` is used to create a new inherited role with other existing roles.

```http
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
   "type":"add_inherited_role",
   "args":{
      "role_name": "sample_inherited_role",
      "role_set": [
         "role1",
         "role2"
      ]
   }
}
```

### Args syntax {#metadata-add-inherited-role-syntax}

| Key       | Required | Schema                                                | Description                                                            |
| --------- | -------- | ----------------------------------------------------- | ---------------------------------------------------------------------- |
| role_name | true     | [RoleName](/api-reference/syntax-defs.mdx#rolename)   | Name of the inherited role                                             |
| role_set  | true     | [[RoleName](/api-reference/syntax-defs.mdx#rolename)] | List of non-inherited roles from which permissions should be inherited |

## drop_inherited_role {#metadata-drop-inherited-role}

`drop_inherited_role` is used to delete an existing inherited role.

```http
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
    "type" : "drop_inherited_role",
    "args" : {
       "role_name": "sample_inherited_role"
    }
}
```

### Args syntax {#metadata-drop-inherited-role-syntax}

| Key       | Required | Schema                                              | Description                |
| --------- | -------- | --------------------------------------------------- | -------------------------- |
| role_name | true     | [RoleName](/api-reference/syntax-defs.mdx#rolename) | Name of the inherited role |
